package com.qd.kiwi;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class MyPagerAdapter extends PagerAdapter {
    private static final String TAG = "MyPagerAdapter";
    private static final boolean DBG = Const.DBG;

    private Context mContext;
    private int[] mRids = {
            R.drawable.img_20121219,
            R.drawable.img_20121221
    };

    public MyPagerAdapter(Context c){
        mContext = c;
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return mRids.length;
    }

    @Override
    public boolean isViewFromObject(View arg0, Object arg1) {
        // TODO Auto-generated method stub
        return arg0==arg1;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        ImageView iv = new ImageView(mContext);

        iv.setImageResource(mRids[position]);
        container.addView(iv);
        return iv;
    }
}
